package com.bookmngsys.dao;

import com.bookmngsys.entity.BorrowHistory;
import com.bookmngsys.entity.FineHistory;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.ArrayList;

public interface FineHistoryDao extends JpaRepository<FineHistory, String> {
    @Query(value = "select * from fine_history", nativeQuery = true)
    ArrayList<FineHistory> getAllFineHistory();

    @Query(value = "select * from fine_history where reader_id = :readerId", nativeQuery = true)
    ArrayList<FineHistory> getAllFineHistoryByReaderId(Integer readerId);

}
